package Java复习;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Num3 {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<String, String>();
        String[] str = {"zhangsan@sohu.com", "lisi@163.com", "wangwu@sina.com"};
        for (String s : str) {
            map.put(s.split("@")[0], s.split("@")[1]);
        }
        Set<Map.Entry<String, String>> set = map.entrySet();
        Iterator<Map.Entry<String, String>> iter = set.iterator();
        while (iter.hasNext()){
            Map.Entry<String, String> entry = iter.next();
            System.out.println(entry.getKey() + ": " + entry.getValue());
        }
    }
}
